"""
@name : ATM存取
@author : shiyaling
@projectname : xsfh
"""
#登入页面
user = [("root","123456"),("user","123123")]
while True:
    print("#######欢迎登入ATM#########")
    username = input("请输入用户名：")
    passwd = input("请输入密码：")
    if (username, passwd) in user:
        print("登入成功！")
        break
    else:
        print("登入错误，请重新输入！")

# 菜单页面
ATM = 50000
if username == "root":
    account = 5000
elif username == "user":
    account = 5000000
while True:
    print("##########菜单页面############")
    print("########1、取款###############")
    print("########2、存款###############")
    print("########3、查询###############")
    print("#########输入exit退出系统######")
    choose = input("输入1进行取款\n"
                   "输入2进行存款\n"
                   "输入3进行查询\n"
                   "请输入您的选择：")
    if choose == "1":
        get = int(input("请输入您要取款的金额:"))
        if get > account:
            print("您的金额不足！")
        elif get > ATM:
            print("不好意思，ATM余额不足！")
        else:
            account = account - get
            print("取款成功!")
    elif choose == "2":
        save = int(input("请输入您要存款的金额："))
        account = account + save
        ATM = ATM +save
        print("存款成功！")
    elif choose == "3":
        print(f"您的账户余额为：{account}")
    elif choose == "exit":
        break
    else:
        print("输入错误，请重新输入！")

print("退出系统，欢迎下次登入")








